/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.SysFloorRecommendPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.ISysFloorRecommendMapper;

@Service
public class SysFloorRecommendService {
	@Autowired
	private ISysFloorRecommendMapper sysFloorRecommendMapper;
	
	/**
	 * 根据ID获取SysFloorRecommendPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return SysFloorRecommendPo
	 */
	public SysFloorRecommendPo getSysFloorRecommend(int id) {
		return sysFloorRecommendMapper.findSysFloorRecommendById(id);
	}
	
	/**
	 * 根据条件获取SysFloorRecommendPo对象，并返回查询的数据总数
	 * 
	 * @param sysFloorRecommend
	 * @Author 迷蝶
	 * @return ResultPageTo<SysFloorRecommendPo>
	 */
	public ResultPageTo<SysFloorRecommendPo> getSysFloorRecommends(SysFloorRecommendPo sysFloorRecommend) {
		return new ResultPageTo<SysFloorRecommendPo>(sysFloorRecommend.getStart(), sysFloorRecommend.getSize(), 
				sysFloorRecommendMapper.findSysFloorRecommendCount(sysFloorRecommend), sysFloorRecommendMapper.findSysFloorRecommends(sysFloorRecommend));
	}
	
	/**
	 * 根据ID删除SysFloorRecommendPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delSysFloorRecommend(int id) {
		return sysFloorRecommendMapper.delSysFloorRecommendById(id);
	}
	
	/**
	 * 增加SysFloorRecommendPo对象
	 * 
	 * @param sysFloorRecommend
	 * @Author 迷蝶
	 */
	public Integer addSysFloorRecommend(SysFloorRecommendPo sysFloorRecommend) {
		return sysFloorRecommendMapper.addSysFloorRecommend(sysFloorRecommend);
	}
	
	/**
	 * 根据条件更新SysFloorRecommendPo对象
	 * 
	 * @param sysFloorRecommend
	 * @Author 迷蝶
	 */
	public Integer updateSysFloorRecommend(SysFloorRecommendPo sysFloorRecommend) {
		return sysFloorRecommendMapper.updateSysFloorRecommend(sysFloorRecommend);
	}
	
}
